filechooserbutton: Use a bin layout
authorTimm Bäder <tbaeder@redhat.com>
Fri, 3 May 2019 06:04:39 +0000 (08:04 +0200)
committerTimm Bäder <mail@baedert.org>
Fri, 3 May 2019 18:06:10 +0000 (20:06 +0200)
gtk/gtkfilechooserbutton.c

index f6bc943746444f905419228cfb5e1ec836778305..ea9de54450582db9c2e7191721aaee300a54dadb 100644 (file)
@@ -49,6 +49,7 @@
 #include "gtkfilechooserprivate.h"
 #include "gtkfilechooserutils.h"
 #include "gtkmarshalers.h"
+#include "gtkbinlayout.h"
 
 #include "gtkfilechooserbutton.h"
 
@@ -339,41 +340,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkFileChooserButton, gtk_file_chooser_button, GTK_TYPE
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_FILE_CHOOSER,
                                                 gtk_file_chooser_button_file_chooser_iface_init))
 
-
-
-static void
-gtk_file_chooser_button_measure (GtkWidget       *widget,
-                                 GtkOrientation  orientation,
-                                 int             for_size,
-                                 int            *minimum,
-                                 int            *natural,
-                                 int            *minimum_baseline,
-                                 int            *natural_baseline)
-{
-  GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
-  GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
-
-  gtk_widget_measure (priv->child, orientation, for_size,
-                      minimum, natural,
-                      minimum_baseline, natural_baseline);
-}
-
-static void
-gtk_file_chooser_button_size_allocate (GtkWidget *widget,
-                                       int        width,
-                                       int        height,
-                                       int        baseline)
-{
-  GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (widget);
-  GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button);
-
-  gtk_widget_size_allocate (priv->child,
-                            &(GtkAllocation) {
-                              0, 0,
-                              width, height
-                            }, baseline);
-}
-
 static void
 gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
 {
@@ -397,8 +363,6 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
   widget_class->root = gtk_file_chooser_button_root;
   widget_class->mnemonic_activate = gtk_file_chooser_button_mnemonic_activate;
   widget_class->state_flags_changed = gtk_file_chooser_button_state_flags_changed;
-  widget_class->measure = gtk_file_chooser_button_measure;
-  widget_class->size_allocate = gtk_file_chooser_button_size_allocate;
 
   /**
    * GtkFileChooserButton::file-set:
@@ -533,6 +497,8 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button)
                     target_list,
                     GDK_ACTION_COPY);
   gdk_content_formats_unref (target_list);
+
+  gtk_widget_set_layout_manager (GTK_WIDGET (button), gtk_bin_layout_new ());
 }